Class MyTitleComparator


  • public class MyTitleComparator
    extends MyTrackComparator
    This class represents the concept of comparison of two track by title.
    Since:
    ExerciseSheet04
    Version:
    1
    Author:
    Jonas Altrock (ew20b126@technikum-wien.at)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(Track t1, Track t2)
      Compares two tracks by title.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MyTitleComparator

        public MyTitleComparator()
    • Method Detail

      • compare

        public int compare​(Track t1,
                           Track t2)
        Compares two tracks by title. Comparison is performed lexicographically on the titles of the two tracks. This comparator does not handle null tracks.
        Specified by:
        compare in class MyTrackComparator
        Parameters:
        t1 - the one track to compare
        t2 - the other track to which t1 is to be compared
        Returns:
        a measure of the distance between t1 and t2 in the sense of the comparator